package com.cj.bus.common.enums;

public enum ErrorCodeEnum {

  SUCCESS(200, "SUCCESS"),
  TOKEN_EMPTY(100, "token为空"),

  NO_PERMISSION(99, "系统未配置请求访问相应的权限"),
  TOKEN_INVALID(110,"token无效"),
  TOKEN_EXPIRED(111,"token过期"),
  TOKEN_INVALID_BY_OTHER_LOGIN(112,"他人登录导致的会话失效"),


  NO_DATA_PERMISSION(401, "无数据操作权限"),
  
  FORBIDDEN(403, "拒绝访问"),
  NOT_FOUND(404, "未找到信息"),
  REG_CODE_ERROR(405, "验证码错误"),
  PARA_ERROR(410, "请求参数错误"),
  PARA_CHECK_ERROR(411, "参数校验错误"),
  SIGN_CHECK_ERROR(521, "校验签名错误"),
  SIGN_PARAM_ERROR(511, "生成签名文件错误"),
  /**
   * 验证码已失效
   */
  REG_CODE_INVALID(406, "验证码已失效"),
  REG_CODE_DUPLICATED(409, "发送验证码过于频繁"),

  NOT_SUPORT_REQUEST_TYPE(444, "不支持的访问类型"),
  OTHER_ERROR(445, "其他错误"),
  SERVER_BUSY_ERROR(446, "服务器繁忙,请稍后重试!"),
  SYS_ERROR(500, "服务器故障"),
  /**
   * 其他
   */
  IO_ERROR(701, "服务器文件服务异常"),

  /**
   * 获取分布式锁失败
   */
  DISTRIBUTED_LOCK_ERROR(600,"获取分布式锁失败");

  
  private Integer code;

  private String desc;
  
  ErrorCodeEnum(Integer code){
    this.code = code;
  }
  
  ErrorCodeEnum(Integer code,String desc){
    this.code = code;
    this.desc = desc;
  }

  public Integer getCode() {
    return code;
  }

  public void setCode(Integer code) {
    this.code = code;
  }

  public String getDesc() {
    return desc;
  }

  public void setDesc(String desc) {
    this.desc = desc;
  }
  
}
